import Vue from 'vue'
import VueCookies from 'vue-cookies'
Vue.use(VueCookies)

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css
import 'font-awesome/scss/font-awesome.scss' // font-awesome基础样式

import iconPicker from 'vue-fontawesome-elementui-icon-picker'
Vue.use(iconPicker)

import App from './App'
import store from './store'
import router from './router'

// import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'
// Vue.component('font-awesome-icon', FontAwesomeIcon)
// Vue.component('font-awesome-layers', FontAwesomeLayers)
// Vue.component('font-awesome-layers-text', FontAwesomeLayersText)

import '@/icons' // icon
import '@/permission' // permission control

import * as filters from './filters' // global filters

import request from '@/utils/request'
Vue.prototype.$http = request

import api from '@/utils/api'
Vue.prototype.$api = api

Vue.use(ElementUI, { size: VueCookies.get('size') || 'mini' })

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.prototype.$htmlparser2 = require('htmlparser2')

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
